// pages/main/index/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    background: [{
      url: '../../index/index',
      title: '产品创新奖',
      title_en: 'product innovation awards',
      btnText: '立即参与'
    },{
      url: '../../index/index',
      title: '产品创新奖',
      title_en: 'product innovation awards',
      btnText: '立即参与'
    },{
      url: '../../index/index',
      title: '产品创新奖',
      title_en: 'product innovation awards',
      btnText: '立即参与'
    }],
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    currentIndex: 0,

    navList: [{
      url: '../about/about',
      icon: '../../../images/icon_nav1.png',
      txt: '关于展会',
      type: 'navigate'
    },{
      url: '#',
      icon: '../../../images/icon_nav2.png',
      txt: '观众注册',
      type: 'navigate'
    },{
      url: '../exhibition/exhibition',
      icon: '../../../images/icon_nav3.png',
      txt: '展商名录',
      type: 'switchTab'
    },{
      url: '../forum/forum',
      icon: '../../../images/icon_nav4.png',
      txt: '同期论坛',
      type: 'navigate'
    },{
      url: '../invitation/invitation',
      icon: '../../../images/icon_nav5.png',
      txt: '邀请函',
      type: 'navigate'
    },{
      url: '../gift/gift',
      icon: '../../../images/icon_nav6.png',
      txt: '赢好礼',
      type: 'navigate'
    },{
      url: '../news/news',
      icon: '../../../images/icon_nav7.png',
      txt: '新闻动态',
      type: 'navigate'
    }],
    navShowConfirm: false,

    articleNavList: [{
      id: 0,
      title: '新闻动态',
      onthis: true
    },{
      id: 1,
      title: '人物访谈'
    },{
      id: 2,
      title: '产业趋势'
    },{
      id: 3,
      title: 'SEMI数据'
    },{
      id: 4,
      title: '工程师故事'
    },{
      id: 5,
      title: '金句短视频'
    }],

    articleList: [{
      url: '../news/newsDetail',
      img: '../../../images/index_article_demo1.jpg',
      views: 999,
      title: '开幕主题演讲',
      intro: '半导体产业是一个关键战略性产业，对于半导体产业是一个关键战略性产业',
      anthor: 'SEMI',
      date: '2025-10-13 08:30:31'
    },{
      url: '../news/newsDetail',
      img: '../../../images/index_article_demo2.jpg',
      views: 999,
      title: '全球半导体产业战略峰会: SEMI产业创新投资论坛',
      intro: 'SEMI投资论坛是SEMI中国旗下的产业与SEMI投资论坛是SEMI中国旗下的产业与',
      anthor: 'SEMI',
      date: '2025-10-13 08:30:31'
    },{
      url: '../news/newsDetail',
      img: '../../../images/index_article_demo3.jpg',
      views: 999,
      title: '集成电路科学技术大会',
      intro: '大会由SEMI、IEEE和中国高科技专家组大会由SEMI、IEEE和中国高科技专家组',
      anthor: 'SEMI',
      date: '2025-10-13 08:30:31'
    }],

    videoList: [{
      id: 0,
      img: '../../../images/index_video_demo2.jpg',
      title: '视频标题示意'
    },{
      id: 1,
      img: '../../../images/index_video_demo3.jpg',
      title: '视频标题示意'
    },{
      id: 2,
      img: '../../../images/index_video_demo4.jpg',
      title: '视频标题示意'
    }],

    imageList: [{
      id: 0,
      img: '../../../images/index_image_demo1.jpg',
      title: '图片标题示意'
    },{
      id: 1,
      img: '../../../images/index_image_demo2.jpg',
      title: '图片标题示意'
    }]
  },

  onSwiperChange(e) {
    this.setData({
      currentIndex: e.detail.current
    });
  },

  indexNavTap(e) {
    let list = this.data.navList, navShowConfirm = this.data.navShowConfirm;
    const len = list.length;
    if(navShowConfirm) {
      list[len - 3] = {
        url: '../invitation/invitation',
        icon: '../../../images/icon_nav5.png',
        txt: '邀请函',
        type: 'navigate'
      };
      list[len - 2] = {
        url: '../gift/gift',
        icon: '../../../images/icon_nav6.png',
        txt: '赢好礼',
        type: 'navigate'
      };
      list[len - 1] = {
        url: '../news/news',
        icon: '../../../images/icon_nav7.png',
        txt: '新闻动态',
        type: 'navigate'
      };
      navShowConfirm = false;
    }else{
      list[len - 3] = {
        url: '#',
        icon: '../../../images/icon_nav8.png',
        txt: '人物访谈',
        type: 'navigate'
      };
      list[len - 2] = {
        url: '#',
        icon: '../../../images/icon_nav9.png',
        txt: '市场趋势',
        type: 'navigate'
      };
      list[len - 1] = {
        url: '#',
        icon: '../../../images/icon_nav10.png',
        txt: 'SEMI数据',
        type: 'navigate'
      };
      navShowConfirm = true;
    }

    this.setData({
      navList: list,
      navShowConfirm
    });
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})